package com.toocms.jinjuhang.dialog.order_cancel

import androidx.databinding.ObservableBoolean
import androidx.databinding.ObservableField
import com.toocms.tab.binding.command.BindingAction
import com.toocms.tab.binding.command.BindingCommand

class OrderCancelItemModel(
    val viewModel: OrderCancelModel,
    val titleObservableField: ObservableField<String>,
    val isSelectedObservableBoolean: ObservableBoolean = ObservableBoolean(false)
) {
    val itemClickBindingCommand = BindingCommand<BindingAction>(BindingAction {
        viewModel.items?.forEach {
            it.isSelectedObservableBoolean.set(it == this@OrderCancelItemModel)
        }
    })
}